package com.bwda.dsrs.filecenter.service.impl;

import com.bwda.dsrs.filecenter.domain.po.keyrule.KeyRulePo;
import com.bwda.dsrs.filecenter.domain.condition.keyrule.KeyRuleCondition;
import com.bwda.dsrs.filecenter.mapper.dsrs.KeyRuleMapper;
import com.bwda.dsrs.filecenter.service.KeyRuleService;
import org.springframework.stereotype.Service;
/**
 * @author Administrator
 */
@Service
public class KeyRuleServiceImpl extends BaseServiceImpl<KeyRulePo, KeyRuleCondition, KeyRuleMapper> implements KeyRuleService {
    /**
     * 钥规则名称是秘否唯一
     * @param ruleName
     * @return 存在则返回false
     */
    @Override
    public boolean isKeyRuleNameUnique(String ruleName) {
        boolean bExist = true;
        Integer count =  this.getMapper().queryCountByRuleName(ruleName);
        if(count>0){
            bExist = false;
        }
        return bExist;
    }
}